package jml.config.cmd;

import java.util.Hashtable;

public class CommandGroup extends Hashtable<String,Hashtable<String,Command>>
{
	private String runtimeScript;
	private String defaultScript;

	public String getRuntimeScript()
	{
		return runtimeScript;
	}

	public void setRuntimeScript(String runtimeScript)
	{
		this.runtimeScript=runtimeScript;
	}

	public String getDefaultScript()
	{
		return defaultScript;
	}

	public void setDefaultScript(String defaultScript)
	{
		this.defaultScript=defaultScript;
	}
	
	public Command getComnand(String type,String name)
	{
		return get(type).get(name);
	}
	
	public void addCommand(String type,Command c)
	{
		Hashtable<String,Command> commands = get(type);
		if( commands == null )
		{
			commands = new Hashtable<String,Command>();
			put(type,commands);
		}
		
		commands.put(c.getName(),c);
	}
}
